package Demo_01;

import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UpdateDemo {
    public List<Map<String,Object>> executeUpdate(String sql){
        List list = new ArrayList();

        String driver = "com.mysql.jdbc.Driver";
        String url = "jdbc:mysql://localhost:3306/jdbc? " +
                "serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false";
        String user = "root";
        String password = "root123";
        Connection conn = null;
        Statement stmt = null;
        ResultSet rst = null;

        try {
            conn = DriverManager.getConnection(url,user,password);
            stmt = conn.createStatement();
            rst = stmt.executeQuery(sql);

            ResultSetMetaData meta = rst.getMetaData();
            int c = meta.getColumnCount();


        } catch (SQLException e) {
            e.printStackTrace();
        } finally
        {

        }

        return list;
    }

    public static void main(String[] args) {
        String sql1 = "select * from tbl_book_info";
        Map<String,Object> mm = new HashMap<>();

    }
}
